const gulp = require("gulp");
const ts = require("gulp-typescript");
const tsProject = ts.createProject("tsconfig.json");
const paths = {
    jsons: ['package.json', 'config*/*.json']
};

gulp.task("tsc", function () {
    return tsProject.src()
        .pipe(tsProject())
        .js.pipe(gulp.dest("dist"));
});

gulp.task("cp-json", function () {
    return gulp.src(paths.jsons)
        .pipe(gulp.dest("dist"));
});

gulp.task("cp-views", function () {
    return gulp.src(["views*/**"])
        .pipe(gulp.dest("dist"));
});

gulp.task("default", ["tsc", "cp-json", "cp-views"]);